<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <title>首页 - 报销系统</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css">
    <style>
        body {
            min-height: 100vh;
            background-color: #f8f9fa;
        }
        .navbar {
            box-shadow: 0 2px 4px rgba(0,0,0,.1);
        }
        .navbar-brand {
            font-weight: 600;
        }
        .content {
            padding: 2rem 0;
        }
        .welcome-card {
            background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
            color: white;
            border-radius: 15px;
            padding: 2rem;
            margin-bottom: 2rem;
            box-shadow: 0 4px 6px rgba(0,0,0,.1);
        }
        .welcome-card h2 {
            margin: 0;
            font-weight: 600;
        }
        .welcome-card p {
            margin: 1rem 0 0;
            opacity: 0.9;
        }
        .function-card {
            background: white;
            border-radius: 15px;
            padding: 1.5rem;
            height: 100%;
            transition: transform 0.2s;
            box-shadow: 0 4px 6px rgba(0,0,0,.1);
        }
        .function-card:hover {
            transform: translateY(-5px);
        }
        .function-card .icon {
            width: 48px;
            height: 48px;
            background-color: #e9ecef;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 1rem;
        }
        .function-card .icon i {
            font-size: 1.5rem;
            color: #0d6efd;
        }
        .function-card h3 {
            font-size: 1.25rem;
            margin-bottom: 0.5rem;
            font-weight: 600;
        }
        .function-card p {
            color: #6c757d;
            margin-bottom: 1rem;
        }
        .function-card .btn {
            width: 100%;
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
        <div class="container">
            <a class="navbar-brand" href="#">报销审批系统</a>
            <div class="d-flex">
                <span class="navbar-text me-3">
                    <i class="bi bi-person-circle me-1"></i>
                    <span sec:authentication="name"></span>
                </span>
                <form th:action="@{/logout}" method="post" class="d-flex">
                    <button class="btn btn-outline-light btn-sm" type="submit">
                        <i class="bi bi-box-arrow-right me-1"></i>退出
                    </button>
                </form>
            </div>
        </div>
    </nav>

    <!-- 主要内容 -->
    <div class="content">
        <div class="container">
            <!-- 欢迎卡片 -->
            <div class="welcome-card">
                <h2>欢迎回来，<span sec:authentication="name"></span>!</h2>
                <p>您的角色：<span sec:authentication="principal.authorities"></span></p>
            </div>

            <!-- 功能卡片 -->
            <div class="row g-4">
                <!-- 报销申请卡片 -->
                <div class="col-md-6" sec:authorize="hasRole('EMPLOYEE')">
                    <div class="function-card">
                        <div class="icon">
                            <i class="bi bi-receipt"></i>
                        </div>
                        <h3>报销申请</h3>
                        <p>提交新的报销申请，跟踪申请进度</p>
                        <a th:href="@{/expense/apply}" class="btn btn-primary">
                            <i class="bi bi-plus-lg me-1"></i>新建申请
                        </a>
                    </div>
                </div>

                <!-- 待办任务卡片 -->
                <div class="col-md-6">
                    <div class="function-card">
                        <div class="icon">
                            <i class="bi bi-list-task"></i>
                        </div>
                        <h3>待办任务</h3>
                        <p>查看和处理待审批的报销申请</p>
                        <a th:href="@{/expense/tasks}" class="btn btn-primary">
                            <i class="bi bi-arrow-right me-1"></i>查看任务
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html> 